home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeModelHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.8 KB  |  68 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import javax.swing.event.TreeModelEvent;
  4. import javax.swing.event.TreeModelListener;
  5. import javax.swing.tree.TreePath;
  6.  
  7. public class BasicTreeUI$TreeModelHandler implements TreeModelListener {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.  
  11.    public BasicTreeUI$TreeModelHandler(BasicTreeUI var1) {
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void treeNodesChanged(TreeModelEvent var1) {
  16.       if (this.this$0.treeState != null && var1 != null) {
  17.          this.this$0.treeState.treeNodesChanged(var1);
  18.          TreePath var2 = var1.getTreePath().getParentPath();
  19.          if (var2 == null || this.this$0.treeState.isExpanded(var2)) {
  20.             this.this$0.updateSize();
  21.          }
  22.       }
  23.  
  24.    }
  25.  
  26.    public void treeNodesInserted(TreeModelEvent var1) {
  27.       if (this.this$0.treeState != null && var1 != null) {
  28.          this.this$0.treeState.treeNodesInserted(var1);
  29.          BasicTreeUI.access$0(this.this$0);
  30.          TreePath var2 = var1.getTreePath();
  31.          if (this.this$0.treeState.isExpanded(var2)) {
  32.             this.this$0.updateSize();
  33.          } else {
  34.             int[] var3 = var1.getChildIndices();
  35.             int var4 = this.this$0.treeModel.getChildCount(var2.getLastPathComponent());
  36.             if (var3 != null && var4 - var3.length == 0) {
  37.                this.this$0.updateSize();
  38.             }
  39.          }
  40.       }
  41.  
  42.    }
  43.  
  44.    public void treeNodesRemoved(TreeModelEvent var1) {
  45.       if (this.this$0.treeState != null && var1 != null) {
  46.          this.this$0.treeState.treeNodesRemoved(var1);
  47.          BasicTreeUI.access$0(this.this$0);
  48.          TreePath var2 = var1.getTreePath();
  49.          if (this.this$0.treeState.isExpanded(var2) || this.this$0.treeModel.getChildCount(var2.getLastPathComponent()) == 0) {
  50.             this.this$0.updateSize();
  51.          }
  52.       }
  53.  
  54.    }
  55.  
  56.    public void treeStructureChanged(TreeModelEvent var1) {
  57.       if (this.this$0.treeState != null && var1 != null) {
  58.          this.this$0.treeState.treeStructureChanged(var1);
  59.          BasicTreeUI.access$0(this.this$0);
  60.          TreePath var2 = var1.getTreePath().getParentPath();
  61.          if (var2 == null || this.this$0.treeState.isExpanded(var2)) {
  62.             this.this$0.updateSize();
  63.          }
  64.       }
  65.  
  66.    }
  67. }
  68.